package com.lz.ionicbase.ui.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import android.telephony.TelephonyManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lz.ionicbase.R;
import com.lz.ionicbase.model.MsgListBean;
import com.lz.ionicbase.utils.Constant;
import com.lz.ionicbase.utils.SpUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by lenovo on 2017/2/4.
 */
public class MessageFragment extends Fragment {
    @InjectView(R.id.msg_recyclerview)
    RecyclerView msgRecyclerview;
    private SpUtils sp;
    private List<MsgListBean> list;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_msg, null);
        ButterKnife.inject(this, view);
        sp = new SpUtils();
        initData();
        return view;
    }

    private void initData() {
        TelephonyManager telephonyManager = (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE);
        String deviceId = telephonyManager.getDeviceId();
        String token = sp.getString(getActivity(), Constant.TOKEN, "");
        Map<String,String> hashMap = new HashMap();
        hashMap.put("uid",deviceId);
        hashMap.put("token",token);
        String neturl = sp.getString(getActivity(), Constant.NET_URL, "");
        String msgurl = neturl+ Constant.MSGURL;

    }

}
